#ifndef I2C_CORE_H
#define I2C_CORE_H

#include "i2c_types.h"

// I2C驱动初始化
I2C_StatusTypeDef I2C_Init(I2C_HandleTypeDef *hi2c, uint32_t frequency);

// I2C发送数据
I2C_StatusTypeDef I2C_MasterSend(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t Timeout);

// I2C接收数据
I2C_StatusTypeDef I2C_MasterReceive(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t Timeout);

// I2C读写组合操作
I2C_StatusTypeDef I2C_MasterTransmit(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pTxData, uint16_t TxSize, uint8_t *pRxData, uint16_t RxSize, uint32_t Timeout);

// I2C关闭
void I2C_DeInit(I2C_HandleTypeDef *hi2c);

#endif // I2C_CORE_H
